﻿using System.Reflection;

namespace Borg
{
    internal class PlugTypePlugTask : Task<PlugTypeInfo>
    {
        private readonly SlotInfo _si;

        public override string Name
        {
            get { return string.Format("Plug({0}, {1})", obj.Name, _si.Name); }
        }

        public PlugTypePlugTask(PlugTypeInfo obj, SlotInfo si, uint taskGroupId, Assembly initiator)
            : base(obj, taskGroupId, initiator)
        {
            _si = si;
        }

        public override void Execute()
        {
            _si.InternalPlug(obj, true, taskGroupId, initiator);
        }

        public override string ToString()
        {
            return string.Format("{0}: {1}.Plug({2})", taskGroupId, obj, _si);
        }
    }
}

